package demo3;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class Person {
    @Autowired//自动装配
    @Qualifier("summer")
   // private Shirt shirt;//定义一个属性
   // private Sweater sweater;
    private Clothes clothes;
    public  void play(){
       // Shirt shirt = new Shirt();//尽量不要new,new会导致强耦合,后期可能导致代码修改
        //shirt.wear();
       // sweater.wear();
        clothes.wear();
        System.out.println("出去玩!");
    }
}
